package jinzhi;
//各位数相加
public class basic258 {
    public int addDigits(int num) {
        int sum=0;
        while (num>0){
          sum+=num%10;
          num=num/10;
//          num=sum;
      }

    return  sum ;



    }

    public static void main(String[] args) {
        basic258 basic258 = new basic258();
        System.out.println(basic258.addDigits(388));



    }



}
